package com.gzk.oeno.ihm.tables.renderer;

import java.awt.Component;

import javax.swing.JTable;
import javax.swing.table.DefaultTableCellRenderer;

import com.gzk.oeno.business.INamed;

public class NameCellRenderer extends DefaultTableCellRenderer {

	@Override
	public Component getTableCellRendererComponent(JTable table, Object value,
			boolean isSelected, boolean hasFocus, int row, int column) {
		super.getTableCellRendererComponent(table, value, isSelected, hasFocus,
				row, column);
		if (value instanceof INamed){
			setText(((INamed) value).getName());
		}
		return this;
	}
	
}
